var api = require('../../utils/api.js');
var app = getApp();
Page({
    data: {
        banner:['https://hangtaoli.oss-cn-beijing.aliyuncs.com/uploads/20240807/87c4596b4dea07e5781b85ada04518da.png'],
        group_id:0
    },
    currentPageNumber: 1,
    onLoad() {
        this.getindexbanner();

    },
    goto(ret){
       
        var url=ret.currentTarget.dataset.url;
        console.log(url);
        wx.navigateTo({
          url: url
        })

    },
    onShow() {

        var that=this;
        api.post({
            url: 'user/index',
            data: {},
            success: data => {
                console.log(data);
                that.setData({
                    group_id:data.data.group_id
                })
            }
        });


    },
    getindexbanner(){
        var that=this;
        api.post({
            url: 'yuyue/getbanner',
            data: {},
            success: data => {
                
                console.log(data);

                if  (data.data){
                    that.setData({
                        banner:data.data
                    })
                }

                
            }
        });

    },

    seeall(){
        wx.navigateTo({
          url: '/pages/index/cate',
        })
    },

    baoming(){
        wx.navigateTo({
            url: '/pages/baoming/index',
          })

    },

    getnews(){
        wx.navigateTo({
            url: '/pages/news/index',
          })

    },

    getkeys(ret){
        this.setData({
            keys:ret.detail.value
        })
    },

    getvideobykye(){
        var key=this.data.keys;
        wx.navigateTo({
            url: '/pages/index/lists?key='+key
          })
    },

    jiafen(){
        wx.navigateTo({
            url: '/pages/otehr/jiafen'
          })
    },
    jinsheng(){
        wx.navigateTo({
            url: '/pages/otehr/jinsheng'
          })
    },
    kaoshi(){
        wx.navigateTo({
          url: '/pages/index/kaoshi',
        })
        
    },
    previewImage(e) {
        wx.previewImage({
            current: '', // 当前显示图片的http链接
            urls: [e.currentTarget.dataset.previewUrl] // 需要预览的图片http链接列表
        });

    },
    onShareAppMessage() {
        return {
            title: '好玩的,都在这儿~~',
            path: '/pages/index/index'
        }
    }

});
